import { _decorator, Component, Node } from 'cc'
import EventMgr from '../runtime/EventMgr'
import { DIRECTION_ENUM, EVENT_NAME_ENUM } from '../enums'
const { ccclass, property } = _decorator

@ccclass('Controller')
export class Controller extends Component {
  /** 触发下一关事件 */
  // onNextLevel() {
  //   EventMgr.Instance.emit(EVENT_NAME_ENUM.NEXT_LEVEL)
  // }

  /** 控制玩家移动的事件 */
  onPlayerCtrl(evt: Event, type: DIRECTION_ENUM) {
    EventMgr.Instance.emit(EVENT_NAME_ENUM.CONTROLLER_MOVE, type as DIRECTION_ENUM)
  }
}
